By pressing CTRL+Z right after that operation, you remove those extra
elements (vertices, edges, or faces). But, in case you forget to press
CTRL+Z or use the Edit → Undo menu, all newly created elements will
stay present until you start to see visual problems from modifiers and
other operations.
You can easily fix that problem with a Merge using the distance option.
Look at Figure 3.25 to see a model that had a canceled extrude for one
of their faces.
Figure 3.25 - Model with duplicated vertices
Visually, the model doesn't seem to have anything wrong with the
polygon structure. But, if you select all vertices and press the M key
(Merge) and choose the "By Distance" option, you will see a message in
the status bar of Blender pointing that it removed four vertices (Figure
3.26).